import hashlib
tea_id = ""
def hash_md5(valid_code):
    m = hashlib.md5()
    m.update(valid_code.encode(encoding='utf-8'))
    valid_code_md5 = m.hexdigest()
    return valid_code_md5

if __name__ == '__main__':
    print(hash_md5('&signKey=123123'))

    valid_code3 = hash_md5("userId=" + tea_id + "&signKey=123123")
    print(valid_code3)